<html>
<head lang="cn">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <title>Model Generator Beta</title>
    <link rel="stylesheet" href="assets/css/amazeui.min.css"/>
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script>
        $(document).ready(function () {
            $(".content").change(function () {
                var selectedvalue = $("input[name='source']:checked").val();
                if (selectedvalue == 'text') {
                    $('#jsonstr_div').attr('class', '');
                    $('#pName').attr('class', '');
                    $('#rulestr_div').attr('class', 'am-hide');
                } else {
                    $('#pName').attr('class', 'am-hide');
                    $('#rulestr_div').attr('class', '');
                    $('#jsonstr_div').attr('class', 'am-hide');
                }
            });
        });
    </script>
</head>
<body>
<br>

<div class="am-g">
    <div class="am-u-lg-6 am-u-md-8 am-u-sm-centered">
        <h3>Model Generator Beta</h3>
        <hr>
        <form method="post" class="am-form" action=".">
            <label for="project">工程名:</label>
            <input type="text" name="project" id="project" value="" placeholder="如：XiyouLibrary" required>
            <br>
            <label for="package">包名/命名空间/文件夹:</label>
            <input type="text" name="package" id="package" value="" placeholder="如：com.xiyoumobile.library" required>
            <br>

            <div id="pName">
                <label for="root_class">Model 根类名:</label>
                <input type="text" name="root_class" id="root_class" value=""
                       placeholder="如：BusinessInfo，自动添加Model后缀，OC添加XYM前缀">
                <br>
            </div>
            <label>生成语言:</label>

            <div class="am-form-group">
                <label class="am-radio-inline">
                    <input type="radio" value="java" name="lang" checked="checked"> Java
                </label>
                <label class="am-radio-inline">
                    <input type="radio" value="cs" name="lang"> C#
                </label>
                <label class="am-radio-inline">
                    <input type="radio" value="oc" name="lang"> Objective-C
                </label>
            </div>
            <div class="am-checkbox">
                <label>
                    <input type="checkbox" name="mapping" checked="checked"> 使用Gson/Newtonsoft.JSON/JsonModel，并建立映射关系
                </label>
            </div>
            <label>JSON来源：</label>

            <div class="am-form-group">
                <label class="am-radio-inline">
                    <input class="content" type="radio" value="text" name="source" checked="checked"> JSON字符串
                </label>
                <label class="am-radio-inline">
                    <input class="content" type="radio" value="rule" name="source"> 服务器请求规则
                </label>
            </div>
            <div id="jsonstr_div">
                <label for="jsonstr">JSON字符串: （如：{"id":"123","name":"book"}）</label>
                <textarea name="jsonstr" rows="5" id="jsonstr"></textarea>
            </div>

            <div id="rulestr_div" class="am-hide">
                <label for="rulestr">服务器请求规则（<a target="_blank" href="request_rules.json">点击查看规则文件示例）：</a></label>
                <textarea name="rulestr" rows="5" id="rulestr"></textarea>
            </div>
            <br>

            <div class="am-cf">
                <button type="submit" class="am-btn am-btn-primary am-btn-block" onclick='return check();'>生成</button>
            </div>

        </form>
        <hr>
        <p><a href='manual.pdf'>使用手册</a>

        <p>© 2015 XiyouMobile.</p>
    </div>
</div>
</body>
</html>